﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IHISCETeim.DAL;
using IHISCETeim.Model;
using IHISCETeim.Library;
using System.Data;

namespace IHISCETeim.BLL
{
    public class PartsBalanceController : BaseController
    {
        public static int Add(List<PartsBalanceInfo> list)
        {
            return PartsBalanceDAL.Add(list);
        }


        public static PartsBalanceInfo GetList(int BID)
        {
            PartsBalanceInfo obj = CBO.FillObject<PartsBalanceInfo>(PartsBalanceDAL.GetList(BID));
            if (obj == null)
                obj = new PartsBalanceInfo();
            return obj;
        }
        /// <summary>
        /// 获取冲帐记录
        /// </summary>
        /// <param name="CID"></param>
        /// <returns></returns>
        public static DataTable GetBalanceList(int CID)
        {
            return PartsBalanceDAL.GetBalanceList(CID);
        }
        /// <summary>
        /// 数据源获取充帐记录
        /// </summary>
        /// <param name="DebtId"></param>
        /// <returns></returns>
        public static DataTable GetDebtBalanceList(int DebtId)
        {
            return PartsBalanceDAL.GetDebtBalanceList(DebtId);
        }

        public static int AddAdjusting(int BID, decimal NewBalanceMoney)
        {
            return PartsBalanceDAL.AddAdjusting(BID, NewBalanceMoney);
        }
    }
}
